package com.imooc.order.client;

import com.imooc.order.dataobject.ProductInfo;
import com.imooc.order.dto.CartDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Name com.imooc.order.client.ProductClient
 * @Description
 * @Author Elwyn
 * @Version 2020/3/17
 * @Copyright 上海云辰信息科技有限公司
 **/
@FeignClient(name = "product")
public interface ProductClient {

	@GetMapping("/msg")
	String productMsg();

	@PostMapping("/product/listForOrder")
	List<ProductInfo> listForOrder(@RequestBody List<String> productIdList);

	@PostMapping("/product/decreaseStock")
	void decreaseStock(@RequestBody List<CartDTO> cartDTOList);
}
